use strict;
use Expect;

my $command = 'telnet';
my $target = '127.0.0.1';

my $timeout = 10;

my $exp = Expect->spawn($command, $target) or die "fail to spawn\n";

$exp->expect($timeout, "#");
$exp->send("enable\n");

$exp->send("logout\n");

$exp->soft_close();
